cmake_minimum_required(VERSION 3.7.0)
project(jkzuc)
set(JKZUC_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR})
include(cmake/build_dir.cmake)
include(cmake/depends.cmake)
include(cmake/version.cmake)
include(cmake/compile.cmake)

include_directories(
    /usr/include/tirpc
    ./
    ./3rd
    ./${HOST_ARCH}/include/
    ./src
    ./src/libnml/inifile
    ./src/libnml/rcs
    ./src/libnml/linklist
    ./src/libnml/os_intf
    ./src/libnml/buffer
    ./src/libnml/cms
    ./src/libnml/nml
    ./src/libnml/posemath
    ./src/zuc
)
link_directories(./${HOST_ARCH}/lib ./3rd/controlcan)


add_executable(zuctaskmod
src/main.cc
)
target_link_libraries(zuctaskmod
zlog
taskmod
nml
jkzucini
jkzuchal
posemath
zucmot
sensormgr
)
install(TARGETS zuctaskmod DESTINATION bin)
add_subdirectory(3rd/libmodbus)
# add_subdirectory(3rd/lua)
add_subdirectory(3rd/SOEM)
add_subdirectory(src/rtbus)
add_subdirectory(src/rtdev)
# add_subdirectory(src/cabidentify)
add_subdirectory(src/log)
add_subdirectory(src/jkutil)
add_subdirectory(src/shutils)
add_subdirectory(src/hwdrv)
add_subdirectory(src/modbus)
add_subdirectory(src/hal)
add_subdirectory(src/hal/sensormgr)
add_subdirectory(src/libnml)
add_subdirectory(src/libnml/inifile)
add_subdirectory(src/libnml/posemath)
add_subdirectory(src/zuc/task)
add_subdirectory(src/zuc/nml_intf)
add_subdirectory(src/zuc/rs274ngc)
add_subdirectory(src/zuc/axis)
add_subdirectory(src/zuc/axisgroup)
add_subdirectory(src/zuc/rob_common)
add_subdirectory(src/zuc/motion)
add_subdirectory(src/zuc/dynamic)
add_subdirectory(src/zuc/kinematics)
add_subdirectory(src/funcio)
add_subdirectory(src/safety)
add_subdirectory(src/safezone)
# add_subdirectory(src/sdk)

# for python
add_subdirectory(src/zuc/usr_intf/JAKAAPP)
add_subdirectory(src/zuc/usr_intf/axis/extensions)

# test
add_subdirectory(test)

include(cmake/install.cmake)

